<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/pages/template/modelo.xhtml">
	<ui:define name="titulo">Localizar Amigos / Friendzone</ui:define>
	<ui:define name="cabecalho">
		<div class="win-commandlayout win-ui-dark"
			style="background-color: #424251; height: 50px; float: left; width: 100%;">
			<div class="win-command">
				<h:graphicImage value="/resources/img/friendzone.png" />
			</div>
			<h:form styleClass="win-command"
				style="float:right; margin-top:-16px;">
				<h:commandLink actionListener="#{auth.logout}">
					<button class="win-command">
						<span class="win-commandicon win-commandring  icon-switch-2"></span>
					</button>
				</h:commandLink>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="corpo">
		<h:form>
			<p:messages showDetail="true" showSummary="false" />
			<p:growl id="messages" showDetail="true" />
			<h3>
				<h:inputText value="#{gerenciadorRelacionamento.filtro}" size="150" />
			</h3>
			<h:commandButton value="Localizar"
				actionListener="#{gerenciadorRelacionamento.filtrarSolicitacao}"
				styleClass="btn" />


			<h:dataTable value="#{gerenciadorRelacionamento.solicitacoes}"
				var="solicitacaoAmizade"
				emptyMessage="Nenhuma Solicitação encontrada.">
				<p:column>
					<f:facet name="header">Nome</f:facet>
					<h:outputText value="#{solicitacaoAmizade.deAmigoSolicitado.nome}" />
				</p:column>
				<p:column>
					<f:facet name="header">Tipo Solicitação</f:facet>
					<h:outputText
						value="#{solicitacaoAmizade.tipoRelacionamento.descricao}" />
				</p:column>
				<p:column >
					<f:facet name="header">Ações</f:facet>
					<h:commandButton value="Aceitar"
						action="#{gerenciadorRelacionamento.aceitar(solicitacaoAmizade)}"
					 />
				</p:column>
				<p:column>
					<f:facet name="header">Ações</f:facet>
					<h:commandButton value="Rejeitar" action="#{gerenciadorRelacionamento.rejeitar(solicitacaoAmizade)}"
						/>
				</p:column>
			</h:dataTable>
		</h:form>
	</ui:define>
</ui:composition>
</html>